﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using theTVDB.Interfaces;

namespace theTVDB.Xml
{
    [XmlRoot]
    public class Mirrors : IXmlCollectionWrapper<Mirror>
    {
        [XmlElement("Mirror")]
        public List<Mirror> InternalList { get; set; }
    }

    public class Mirror : IMirror
    {
        [XmlElement("id")]
        public int ID { get; set; }
        [XmlElement("mirrorpath")]
        public string MirrorPath { get; set; }
        [XmlElement("typemask")]
        public byte TypeMask { get; set; }

        [XmlIgnore]
        public FileTypes SupportedFileTypes
        {
            get { return (FileTypes)this.TypeMask; }
            set { this.TypeMask = (byte)value; }
        }
    }
}